/**
 * @ClassName LC1716
 * @Author ykx
 * @Date 2024/3/20 18:39
 * @Version 1.0
 */
public class LC1716 {
    public static void main(String[] args) {
        LC1716 lc1716 = new LC1716();
        System.out.println(lc1716.totalMoney(20));
    }

    public int totalMoney(int n) {
        int sum = 0;
        if (n == 1) {
            return 1;
        } else {
            int money = (n - 1) / 7 + (n - 1) % 7 + 1;
            sum = sum + money;
            return sum + totalMoney(n - 1);
        }
    }
}
